<template>
  <div class="child">
    <h4>这是child组件</h4>
    {{ sum }}
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  name: "child",
  async setup(){
    let sum = ref(0)
    let p =new Promise((resolve)=>{
      setTimeout(()=>{
        resolve(sum)
      },2000)
    })

    return await p
  }
};
</script>

<style scoped>
.child {
  background-color: skyblue;
  padding: 15px;
}
</style>
